From: Aaron Schulz Date: Tue, 3 Mar 2009 23:47:16 +0000 (+0000) Subject: * Only show private logs on specific request X-Git-Tag: 1.31.0-rc.0~42621 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=76b9c5d1d2c90995274b1803d2ced3cb453dc7b1;p=lhc%2Fweb%2Fwiklou.git * Only show private logs on specific request * Tweak suppress log header to be more like oversight --- diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index e8d437910e..c1ed5e0d06 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -447,15 +447,16 @@ class LogEventsList { /** * SQL clause to skip forbidden log types for this user * @param $db Database + * @param $audience string, public/user * @return mixed (string or false) */ - public static function getExcludeClause( $db ) { + public static function getExcludeClause( $db, $audience = 'public' ) { global $wgLogRestrictions, $wgUser; // Reset the array, clears extra "where" clauses when $par is used $hiddenLogs = array(); // Don't show private logs to unprivileged users foreach( $wgLogRestrictions as $logType => $right ) { - if( !$wgUser->isAllowed($right) ) { + if( $audience == 'public' || !$wgUser->isAllowed($right) ) { $safeType = $db->strencode( $logType ); $hiddenLogs[] = $safeType; } @@ -540,16 +541,17 @@ class LogPager extends ReverseChronologicalPager { if( isset($wgLogRestrictions[$type]) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) { $type = ''; } - // Don't show private logs to unpriviledged users - $hideLogs = LogEventsList::getExcludeClause( $this->mDb ); + // Don't show private logs to unpriviledged users. + // Also, only show them upon specific request to avoid suprises. + $audience = $type ? 'user' : 'public'; + $hideLogs = LogEventsList::getExcludeClause( $this->mDb, $audience ); if( $hideLogs !== false ) { $this->mConds[] = $hideLogs; } - if( !$type ) { - return false; + if( $type ) { + $this->type = $type; + $this->mConds['log_type'] = $type; } - $this->type = $type; - $this->mConds['log_type'] = $type; } /** diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 3937df8072..2ecd0d1a02 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1346,7 +1346,8 @@ Please confirm that you intend to do this, that you understand the consequences, # Suppression log 'suppressionlog' => 'Suppression log', 'suppressionlogtext' => 'Below is a list of deletions and blocks involving content hidden from administrators. -See the [[Special:IPBlockList|IP block list]] for the list of currently operational bans and blocks.', +See the [[Special:IPBlockList|IP block list]] for the list of currently operational bans and blocks. +Releasing this information can result in \'\'permanent\'\' loss of Suppression privileges. ', # History merging 'mergehistory' => 'Merge page histories', @@ -2202,7 +2203,7 @@ Each row contains links to the first and second redirect, as well as the target 'specialloguserlabel' => 'User:', 'speciallogtitlelabel' => 'Title:', 'log' => 'Logs', -'all-logs-page' => 'All logs', +'all-logs-page' => 'All public logs', 'alllogstext' => 'Combined display of all available logs of {{SITENAME}}. You can narrow down the view by selecting a log type, the user name (case-sensitive), or the affected page (also case-sensitive).', 'logempty' => 'No matching items in log.',